package com.zj.eswrapper.interfaces.impl;

import com.zj.eswrapper.interfaces.IEsAggWrapper;
import com.zj.eswrapper.model.Agg;

/**
 * @author 19242
 */
public abstract class AbstractEsAggWrapper<Field, AggWrapper extends AbstractEsAggWrapper<Field, AggWrapper, QueryWrapper, SearchBuilder, AggBuilder>, QueryWrapper, SearchBuilder, AggBuilder>
        implements IEsAggWrapper<Field, AggWrapper, QueryWrapper, SearchBuilder, AggBuilder> {

    /**
     * 聚合名
     */
    protected Agg<AggBuilder> agg = new Agg<>();

    public AbstractEsAggWrapper() {
    }

    public AbstractEsAggWrapper(AbstractEsAggWrapper<?, ?, ?, SearchBuilder, AggBuilder> aggWrapper) {
        agg = aggWrapper.agg;
    }

    /**
     * 创建子类
     *
     * @return this
     */
    protected abstract AggWrapper createWrapper();

    /**
     * 创建条件拼接器
     *
     * @return 条件器
     */
    protected abstract QueryWrapper createQueryWrapper();

}
